package kmeansclustering;

import java.io.BufferedReader;
import java.io.FileReader;
import java.util.ArrayList;
import java.util.Iterator;

public class Test {
	public static void main(String[] args) {
		ArrayList<Point1> array = new ArrayList<>();
		for (int i = 0; i < 100; i++) {
			Point1 p = new Point1(10, 10);
			array.add(p);
		}
		Iterator<Point1> iterator = array.iterator();
		while (iterator.hasNext()){
			System.out.println("X of point : " + iterator.next().x);
		}
		ArrayList<Integer> arr = new ArrayList<>();
		arr.add(1);
		arr.add(2);
		arr.add(10);
		System.out.println("test arraylist : " + arr.get(0));
	}
}

class Point1{
	int x;
	int y;
	public Point1(int x, int y) {
		this.x = x;
		this.y = y;
	}
}

// in clustering
//loop until end condition is satisfied
//for(int i=0;i<sumOfLine;i++){
//    for(int j=0;j<sumOfColumn;j++)
//        System.out.println(data[i][j]);
//    System.out.println("sum of rows : " + (i+1));
//}

//for (int i = 0; i < sumOfLine; i++) {
//	int[] property = new int[sumOfColumn];
//	for (int j = 0; j < sumOfColumn; j++) {
//		// property of a Point Object
//		property[j] = this.data[i][j];
//	}
//	Point point = new Point(property, i); // init a Point object
//	points.add(point);
//}

// load dataset from txt file
//public Dataset loadDataset() {
//	int sumOfLine = countLine(this.filePath);
//	int[][] data = new int[sumOfLine][10];
//	ArrayList<String> dt = new ArrayList<String>();
//	try {
//		FileReader inputFile = new FileReader(this.filePath);
//		BufferedReader bufferReader = new BufferedReader(inputFile);
//		String line;
//		int i = 0;
//		int j = 0;
//		while ((line = bufferReader.readLine()) != null) {
//			// System.out.println(line);
//			dt.add(line);
//			sumOfLine += 1;
//			// data[i][j]
//		}
//		System.out.println(dt);
//	} catch (Exception e) {
//		// TODO Auto-generated catch block
//		e.printStackTrace();
//		System.out.println("Error when load dataset");
//	}
//	return new Dataset(sumOfLine, data);
//}